Internet is formed of a plurality of networks connected to each other, wherein each of the constituent networks maintains its identity. Each network supports communication among devices connected to the networks, and the networks in their turn are connected by routers. Thus, Internet can be considered to comprise a mass of routers interconnected by links. Communication among nodes (routers) on Internet takes place using an Internet protocol, commonly known as IP. IP datagrams (packets) are transmitted over links from one router to the next one on their ways towards the final destinations. In each router a forwarding decision is performed on incoming datagrams to determine the datagrams next-hop router.
Sometimes it is also desirable to block traffic or perform other specific actions depending on the nature of the traffic. This usually depends on which class the traffic belongs to among a number of pre-defined classes or policies. Each class is defined by a set of properties of the set of header fields of the packets. Typically, each header field in each class is defined by an interval, which can also be a single value, and the classes, or rules, are organized as a linear list of rules.